<html>
<link rel="stylesheet" href="static/css/myFall.css" />

<script src="static/js/jaliswall.js"></script>     
<style  type="text/css">
.container{
	max-width:1600px;
	margin: 0 auto;
}
</style>
<script>
	$(function() {
		$('#loginSub').on('click', function() {
			if (($("#log_username").val().trim()) == '') {
				alert('账号不可为空！');
				return;
			}
			if (($("#log_password").val().trim()) == '') {
				alert('密码不可为空！');
				return;
			}

			let obj = {};
			obj.username = $("#log_username").val().trim();
			obj.password = $("#log_password").val().trim();

			$.ajax({
				url : "user?method=login",
				type : "POST",
				scriptCharset : 'utf-8',
				data : JSON.stringify(obj),
				contentType : "application/json; charset=utf-8",
				success : function(res) {
					let data = JSON.parse(res)
					console.log("res", data)
					if (data.code === 0) {
						alert("登录" + data.msg);
						window.location.reload()
						/* 						 $("body").load("index"); //很关键！
						 */
					}
				},
				error : function(res) {
					console.log("res", res)
					alert(res);
				}
			});
			console.log('data', $('form').serializeArray())

		});
		$(function() {
			$('.wall').jaliswall();
		});

	});
	function detail (id){
		$.get("news", { method: "detail_page", id: id },
				  function(data){
			try{
				let res = JSON.parse(data)
				console.log(res)
				console.log(res.code == -1)
				console.log(res.code)
				if(res.code == -1 ){
				$("#modal-282050").click();		 	
				}else(
				location.href=("news?method=detail_page&id="+id)	
				)
			}catch(e){
				location.href=("news?method=detail_page&id="+id)	
			}
			
		
				  })
	};
</script>
</head>
<body>

	<div class="container">
		<div class="row clearfix">
		 <a id="modal-282050" href="#modal-tip" style="display:none" role="button" class="" data-toggle="modal"></a>
			<div class="modal fade" id="modal-tip" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
							<h2 class="modal-title" id="myModalLabel">
								恭喜🎉
							</h2>
						</div>
						<div  class="modal-body">
							<h3 style="color:red">您未登录，或登录已过期。
							<p>您可以选择：</p></h3>
						</div>
						<div class="modal-footer">
						<a data-toggle="modal" data-target="#login" class="btn " type="button"  data-dismiss="modal" href=""><span class="glyphicon glyphicon-log-in"></span> 去登录
						<a data-toggle="modal" data-target="#login" class="btn " type="button"  data-dismiss="modal" href=""><span class="glyphicon glyphicon-log-in"></span> 还是去登录
						</div>
					</div>
					
				</div>
				
			</div>
			<div  id="refresh" class="col-md-12 column">
				<div class="jumbotron"
					style="background-image: url(https://timgsa.baidu.com/timg?image&amp;quality=80&amp;size=b9999_10000&amp;sec=1536091006018&amp;di=5276edbc075bd209e4577e10841b168b&amp;imgtype=0&amp;src=http%3A%2F%2Fpic.qiantucdn.com%2F58pic%2F17%2F98%2F84%2F93T58PICPxz_1024.jpg); background-size: 100%;">
					<h1>郑州新闻</h1>
					<p>这里有最准确的...</p>
					<p>这里有全郑州最及时的...</p>
					<p>这里有全郑州人最关注的...</p>
					<p>
						<a class="btn btn-primary btn-large" href="news?method=list"> 查看详情</a>
					</p>
				</div>
			</div>
		</div>
		<div class="row clearfix">
		<p><h1> 时下最热
		<a style="color:red">
		<span class="glyphicon glyphicon-fire" /><span class="glyphicon glyphicon-fire" /><span class="glyphicon glyphicon-fire" />
		</a>
		</h1></p>
		
			<div>
		</div> 
		</div> 
		</div> 
		
			
	</div>
	
		<script
		src="https://cdn.bootcss.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>   
		
</body>


</html>

